/****** Object: View [dbo].[vw_ContractBasic]   Script Date: 2014-01-19 21:49:02 ******/
USE [SHMIS];
GO
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[vw_ContractBasic]'))
BEGIN
DROP VIEW [dbo].[vw_ContractBasic];
END
GO

SET ANSI_NULLS ON;
GO
SET QUOTED_IDENTIFIER ON;
GO
CREATE VIEW dbo.vw_ContractBasic
AS
   SELECT cm.Contract_Num,
          c.customer_code,
          c.customer_simple_code,
          c.customer_name,
          c.customer_simple_name,
          c.industry,
          c.industry_detail,
          cm.Store_Full_Name,
          cm.Position_Code,
          cm.Need_Notice,
          cm.Verified,
          cm.Deleted,
          cm.Ammeter_Code,
          cm.Watermeter_Code,
          cm.Advertisment_Code,
          cm.Chg_Date,
          cm.Cre_Date,
          cm.Chg_User,
          cm.Cre_User,
          cm.Verify_User,
          cm.Verify_SerialNum,
          cm.Terminated
     FROM dbo.BI_ContractMain cm
          INNER JOIN dbo.BI_Customer c ON cm.Customer_Code = c.customer_code
    WHERE     /*cm.Verified = '1'
          AND cm.Deleted = '0'
          AND*/ c.Verified = '1'
          AND c.Deleted = '0'
GO

